arrPodRazdel = {};

function joinToFirm() {
    
    var idFirm = document.getElementById('idFirm').value;
    var postInFirm = document.getElementById('postInFirm').value;
    
    
    var dataSend = {
        query : 'joinToFirm',
        idFirm : idFirm,
        postInFirm : postInFirm
    }

        $.post(
            W_AJAX + "controllers/controllerCompany.php",
            {
                dataSend : dataSend
            },
            function(data){
                var serverAnswer = data;
                },
            'json'
        );
    
    
}

function lookFirm(idFirm) {

    location.href = W_ABSPATH + 'firm/' + idFirm;

}

function editFirm(idFirm) {

    location.href = W_ABSPATH + 'editfirm/' + idFirm;

}

function showPodRazdel(numPodRazdel){
    if (typeof arrPodRazdel[numPodRazdel] == 'undefined')
        arrPodRazdel[numPodRazdel] = false;
    
        if (arrPodRazdel[numPodRazdel])
            hidePodRazdel(numPodRazdel);
        else{
            arrPodRazdel[numPodRazdel] = true;
        
            var elem = "podRazdel_" + numPodRazdel;
            var options = {};
            $("#"+elem).show( "blind", options, 500, function(){}); 
        }  
}

function hidePodRazdel(numPodRazdel){
    var elem = "podRazdel_" + numPodRazdel;
    var options = {};
    $("#"+elem).hide( "blind", options, 500, function(){}); 
    arrPodRazdel[numPodRazdel] = false;
}